<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>删除DOM节点</title>
</head>
<body>
<ul id="myList"><li>Coffee</li><li>Tea</li><li>Milk</li></ul>
<p id="demo">点击按钮来删除列表中的首个项目。</p>
<button onclick="myFunction()">试一下</button>
<script>
    function myFunction()
    {
        var list=document.getElementById("myList");
        list.removeChild(list.childNodes[0]);
    }
</script>
</body>
</html>